Sega Li 1.11.5 is a freeware open source NES/Famicom emulator for
Microsoft Windows, (C) 2005-2011 hap, http://tsk-tsk.net/

YM2413 emulator 1.0 (C) 2002 Jarek Burczynski, http://www.mamedev.org/
nes_ntsc 0.2.2 (C) 2005-2007 Shay Green, http://www.slack.net/~ant/
zlib 1.2.3 (C) 1995-2005 Jean-loup Gailly and Mark Adler, http://www.zlib.net/
unzip 1.01e (C) 1998-2005 Gilles Vollant, http://www.winimage.com/zLibDll/minizip.html
UI shared with meisei, (C) 2005-2011 hap, http://tsk-tsk.net/

MOS 6502 emulation based on Commodore's "NMOS 6500 Microprocessors" datasheet.
NES PPU emulation mostly based on documentation by Brad Taylor and loopy. NES
APU emulation based on blargg's documentation. YM2149 emulation based on
AY-3-8910 datasheet, and detailed information from the MAME team. Mappers
emulation mostly based on documentation by Kevin Horton and Martin Korth.

Compiled with GCC 4.5.0, using MinGW, http://www.mingw.org/

Also thanks to: blargg, Brad Taylor, Chris Covell, Disch, dvik, \Firebug\,
Frits Hilderink, goroh, Kevin Horton, loopy, MAME team, Martin Freij, Matrixz,
NewRisingSun, Okita, Paul, Peter Ammon, Quietust, Salomo, Samor, Y0SHi,
ZSNES team, and the people at http://nesdev.parodius.com/

Sega Li may be freely distributed, not for commercial purposes.
The source code can be obtained from my homepage. If you want to reuse anything,
go ahead, as long as you credit me, and your project is open source too.


== It is ==

Indeed it is! You know, there aren't many ways to say how great this emulator
is, because it's really not. It's still in kids shoes, and they're not even
Nike's. Still, an emulator is an emulator, it does what you expect it to do,
right? You can play Super Mario Bros in this, and that's all what matters to
most. But if you're willing to delve deeper into this, read on.

What?! It's not a Sega emulator then? Nope, sorry, Segali is the surname of a
certain Mario whom Nintendo accordingly named their happy moustached mascot
after. This thing emulates the NES/Famicom, quite accurately I might add. With
the emphasis on might, because, like I gestured, I'm not there yet: most
notable missing features are savestates/movies, debugger, FDS, and zapper
support... don't worry, they're on my imaginary todo list.

This is boring, just open the .exe already.



== How ==

You probably figured you can open a game via the menu, guess what? you can also
open one by using the commandline, or dragging-dropping a file onto the main
window/executable. Once the game is running, the standard keys for the first
joypad are up, down, left, right, and Z, X, C, V for B, A, Select, Start. If
you want to know the other default keys, exit the emulator and open the .ini
file it just generated. Most of the emulator options can be set there.

Anyway, back to opening games. If you actually didn't find out you can use the
menu to open one, check it out. You'll see a standard Open dialog, with an
extra chunk you can change ROM properties at. If you don't trust the iNES
header, change those properties. For a list of known mapper types and the games
that run on them, have a look at mapper_build_std_info in mapper.c, which
directs you to sub mapper modules. If the iNES header is really messed up, you
can edit it manually after pressing, what else, the Edit button. You can't edit
zipped ROMs though.

mapper.c ... what? Oh, that's source code, it's okay if you don't know anything
about programming, it's basically just a mixture of maths and English, and the
stuff between /* these things */ is commentary. You can get the source code at
my homepage.

A few lines above, I overheard myself mentioning an .ini file. Most of the
settings in it are pretty self explanatory, and those that aren't, are
explained underneath:

* Graphics settings:
- [frameskip] is not a yes/no setting, other than 'auto', use a number here to
  make it skip every n frames.
- [stretch to fit], sounds like sexy underpants to me, I got the name from
  MAME. What it does, when enabled, it stretches the NES image to the size of
  the window, instead of at the chosen aspect ratio.
- [software rendering] forces DirectX to use system memory instead of video
  memory, as a side effect it will also disable image blur when resized with
  DirectDraw.
- [bilinear filtering] only affects the Direct3D renderer, it can cause weird
  artifacts when disabled while using a non-standard window size.
- [... border] does what it says, and you can also, to some extent, give
  negative values to these, to enable overscan.
- [video signal], select RGB as video signal for sharp image quality, and
  (relatively) faster rendering. The other choices simulate NTSC. For more
  information about custom settings, have a look at nes_ntsc.*.
- [background colour] is English spelling. It's a colour from the NES palette.

* Sound/Timing settings:
- [frames in buffer] is the sound buffer length, the more frames, the more lag
  but more stability, the other way around for less frames.
- [CPU speed percentage] will let the NES CPU run at a different speed, while
  still having the other NES components run at their original speeds. Use this
  eg. if you want to get rid of natural slowdown in games. Be careful though,
  many games expect the NES for what it is, and don't work well on non-100%.
- [priority], as a warning, better not use anything other than 'auto' or
  'normal' if you've disabled [sleep while waiting].

* File settings:
- [open filetype index] is the "Files of type" combobox in the Open dialog.
- [games path] is the path the Open dialog directs to, it will automatically
  remember the folder of the last successfully opened file.
- [palette path], if you've set the [palette] setting to 'auto', when opening a
  game, it will try to load [gamename].pal/zip, if it can't find that, it'll
  try to load default.pal/zip, and if it still fails, it will use the decoder.
  [auto save palette] will also save the last used palette to this path.
- [patch path], when loading a game, the emulator will look inside this folder
  to find [gamename].ips/zip (eg. a Jap->Eng translation IPS), and patches the
  game without altering the source file.
- [samples path], some games support samples via an external zipped file named
  [gamename(can be partial)].zip. The samples must be uncompressed PCM, named
  ..00-..xx.wav. Refer to the source file sample.c for more information.

* Cartridge settings:
Some cartridges contain (DIP) switches, to know which, mapper_switches in
mapper.c will tell you.

* Input settings:
For information on controllers, have a look at the cont_*.c modules.

- [update frequency] is the maximum number of times per frame inputs may be
  updated.

Then there's a big list of input trigger rules. Use | for OR, & for AND, ! for
NOT. Priorities are ! > & > |. For a full list of known triggers, check the
first half of the input.c module. Some special triggers:
- [nothing], no key is mapped.
- [IsActive] is a flag that's on if inputs are enabled, and otherwise off.
- [IsFocus] is a flag that's on if the main window is in the foreground.
- [dblclick()] reacts as a single pulse when you double click on the client
  area with the system mouse
- [rapid(f,key)] is a rapid fire function, you can also use 'turbo' for this,
  f=frequency (number), key=key, duh.
- [toggle(key)] is a toggle function, press the key once to enable it, and
  again to disable it.
- [sound(threshold%)] reads the currently selected sound capture device, eg.
  the PC microphone, and will trigger if the volume is over the threshold. This
  percentage parameter is optional, by default using 75%.

An example combination: toggle(A)&rapid(5,!nothing) would result in an
automatic rapid fire that can be turned on and off with the A key.


Chances are big you're either me or a friend of mine, so if I missed anything,
no biggie.



== Newest Changes ==

Refer to history.txt for the complete list.

11-10-10: 1.11.4
I haven't worked on Sega Li since late 2008. It would be a shame letting
the progress after 1.11.3 fade away on my harddisk, so, after a mild peak
of interest in the good old NES due to a friend currently developing a NES
emulator for the MSX platform(!), I spent this weekend fixing things up.
I feel asleep!!

- mappers: MMC1 SOROM/SXROM is autodetected by SRAM size (same as with MMC6)
- UI: added dialog for setting directories
- CPU: fixed several undocumented opcodes (blargg testroms)
- CPU: improved simultaneous NMI+IRQ/BRK behaviour (blargg testroms)
- improved power-on/reset timing and initial state (blargg testroms)
- UI: remember full screen/window setting on exit
- PPU: fixed PPU read buffer ($2007) changing during rendering
- mappers: proper support for iNES mapper #185 (copy protected CNROM)
- CPU: added dummy reads quirk on (ZP),Y and ABS,X opcodes (blargg testroms)
- removed 'firmware' game NeSnake 2 from the release build, I'm pretty certain
  that, unlike with meisei, people and Googlebots downloading my emulator have
  a stash of NES romzies ready to be played. Lots of thanks to Matrixz for
  having allowed me to include his game with Sega Li!
- UI: imported many bugfixes from meisei (my MSX emulator sharing the same UI)
- fixed system pauses with D3D if the window was minimized but still active

09-01-11: 1.11.5
This is just a minor annoyance fix, the previous version whined about a
missing zlib dll and this one doesn't anymore. Don't bother posting about
it on your emulation news site. :P

